package com.atguigu.gmall.feign.order;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.order.entity.OrderInfo;
import com.atguigu.gmall.order.vo.OrderConfirmRespVo;
import io.swagger.annotations.Api;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@Api(tags = "远程调用-订单")
@FeignClient("service-order")
@RequestMapping("/api/inner/rpc/order")
public interface OrderFeignClient {

    //获取订单确认数据
    @GetMapping("/confirmdata")
    public Result<OrderConfirmRespVo> orderConfirmData ();

    //根据 orderId,userId 查询订单数据 orderInfo
    @GetMapping("/info/{id}")
    public Result<OrderInfo> getOrderInfoById(@PathVariable("id") Long id);

    //保存秒杀单
    @PostMapping("/seckill/order")
    public Result<Long> saveSeckillOrder(@RequestBody OrderInfo orderInfo);
}
